package com.colldown.iservice.demo.dao.impl;

import java.awt.print.Paper;
import java.util.List;
import java.util.Map;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.colldown.iservice.demo.dao.IDemoDao;
import com.colldown.iservice.demo.po.DemoPo;
import com.github.pagehelper.PageHelper;
@Repository
public class DemoDaoImpl implements IDemoDao {
	
	 @Autowired  
	 protected SqlSessionTemplate sqlSessionTemplate;

	@Override
	public String queryDemo(Map map) {
		
		List list = this.sqlSessionTemplate.selectList("com.iservice.demo.getDemo",map);
		
		return "hello world! this is a demo!"+ ((DemoPo)list.get(0)).getDemoRemark();
	}


	@Override
	public List queryZxt(Map map) {
		PageHelper.startPage(1, 10);
		List list = this.sqlSessionTemplate.selectList("com.iservice.demo.queryZxt",map);
		return list;
	}

}
